<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
    <table>
        <tbody>
        <volist name="relationList" id="rs">
            <tr data-id="{$rs['id']}">
                <td class="sign">
                    <div style="width: 24px;"><i class="ico-check"></i></div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 40px;">{$rs['id']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 150px;">{$rs['relation_name']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$rs['big_out_number']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$rs['big_out_award']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$rs['small_out_number']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$rs['small_out_award']}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 150px;">{$rs['create_time']}</div>
                </td>
                <td align="center" class="handle">
                    <div style="text-align: center; width: 100px; max-width:250px;">
                        <a class="btn blue" href="{:U('Admin/Distribut/edit_relation',['id'=>$rs['id']])}"><i class="fa fa-pencil-square-o"></i>修改</a>
                        <a class="btn red"  href="javascript:void(0)" data-id="{$rs['id']}"  data-url="{:U('Admin/Distribut/delete_relation')}" onClick="delfun(this)"><i class="fa fa-trash-o"></i>删除</a>
                    </div>
                </td>
                <td align="" class="" style="width: 100%;">
                    <div>&nbsp;</div>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
<!--分页位置-->
{$page}
<script>
    $(".pagination  a").click(function(){
        var page = $(this).data('p');
        ajax_get_table('search-form2',page);
    });
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid >table>tbody>tr').click(function(){
            $(this).toggleClass('trSelected');
        });
        $('#user_count').empty().html("{$pager->totalRows}");
    });
    function delfun(obj) {
        // 删除按钮
        layer.confirm('确认删除？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {id : $(obj).attr('data-id')},
                dataType: 'json',
                success: function (data) {
                    layer.closeAll();
                    if (data.status == 1) {
                        $(obj).parent().parent().parent().remove();
                    } else {
                        layer.alert(data.msg, {icon: 2});
                    }
                }
            })
        }, function () {
        });
    }
</script>